<!DOCTYPE html>
<html lang="en">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
	<meta name="renderer" content="webkit" />
	<meta name="force-rendering" content="webkit" />
	<title></title>
	<link type="text/css" rel="stylesheet" href="${base}/templates/${config.theme}/mobile/css/style.css" />
	<script src="${base}/templates/${config.theme}/mobile/js/jquery.min.js"></script>
</head>

<body>
<div class="headerbox">
	<div class="header">
		<div class="headerL">
			<a onclick="javascript:history.back(-1)" class="goback"><img src="${base}/templates/${config.theme}/mobile/images/goback.png" /></a>
		</div>
		<div class="headerC">
			<p>修改密码</p>
		</div>
		<div class="headerR"></div>
	</div>
</div>
<div class="clear"></div>
<div class="hbox"></div>
<div class="kbox"></div>
<form action="${base}/member/password/update" method="post" id="inputForm">
<div class="updateDiv">
	<div class="addiv1">
		<div class="addiv1_l">当前密码：</div>
		<div class="addiv1_r"><input name="currentPassword" id="currentPassword" type="password" value="" maxlength="50" placeholder="6－20位字母、数字结合"/></div>
	</div>
	<div class="addiv1">
		<div class="addiv1_l">密码：</div>
		<div class="addiv1_r"><input name="password" id="password" type="password" value="" maxlength="50" placeholder="6－20位字母、数字结合" /></div>
	</div>
	<div class="addiv1">
		<div class="addiv1_l">确认密码：</div>
		<div class="addiv1_r"><input name="rePassword" id="rePassword" type="password" value="" maxlength="50" placeholder="6－20位字母、数字结合" /></div>
	</div>
</div>

<div class="clear"></div>
<div class="kbox"></div>
	<input type="submit" class="btn_red" value="确认" autocomplete="off" style="    width: 100%;
    height: 2.5rem;
    background: url(/templates/default/mobile/images/tcbg.jpg) repeat-y;
    margin-top: 2rem;
    border: none;
    color: #fff;" />
</form>

<script type="text/javascript">
	$(document).ready(function() {
		$('#inputForm').submit(function() {
			if($('#currentPassword').val() == ''){
				alert('请输入当前密码！');
				return false;
			}
			if($('#password').val() == ''){
				alert('请输入密码！');
				return false;
			}
			if($('#rePassword').val() != $('#password').val()){
				alert('两次输入密码不一致，请重新输入！');
				return false;
			}

			$.ajax({
				url: "${base}/member/password/update",
				type: "POST",
				data: $('#inputForm').serialize(),
				success: function(data){
					if(data.type=="success"){
						location.href="${base}/member";
					}else{
						alert(data.content);
					}
				}
			});

			return false;

		});
	});
</script>

</body>

</html>